#!/bin/bash

aliregistry="registry.cn-zhangjiakou.aliyuncs.com/3rdimages/"

read -p "docker login aliyun"
docker login registry.cn-zhangjiakou.aliyuncs.com

# Infrastructure

read -p "caddy"
maintainer=""
image="caddy:latest"
docker pull $maintainer$image
docker tag $maintainer$image $aliregistry$image
docker push $aliregistry$image

read -p "frps"
maintainer="snowdreamtech/"
image="frps:latest"
docker pull $maintainer$image
docker tag $maintainer$image $aliregistry$image
docker push $aliregistry$image

read -p "frpc"
maintainer="snowdreamtech/"
image="frpc:latest"
docker pull $maintainer$image
docker tag $maintainer$image $aliregistry$image
docker push $aliregistry$image

# Apps

read -p "mariadb"
maintainer=""
image="mariadb:lts"
docker pull $maintainer$image
docker tag $maintainer$image $aliregistry$image
docker push $aliregistry$image

read -p "alpine"
maintainer=""
image="alpine:latest"
docker pull $maintainer$image
docker tag $maintainer$image $aliregistry$image
docker push $aliregistry$image

read -p "fireflyiii"
maintainer="fireflyiii/"
image="core:latest"
docker pull $maintainer$image
docker tag $maintainer$image ${aliregistry}fireflyiii_core:latest
docker push ${aliregistry}fireflyiii_core:latest

read -p "kosync"
maintainer="koreader/"
image="kosync:latest"
docker pull $maintainer$image
docker tag $maintainer$image $aliregistry$image
docker push $aliregistry$image

read -p "mariadb"
maintainer=""
image="mariadb:10.11"
docker pull $maintainer$image
docker tag $maintainer$image $aliregistry$image
docker push $aliregistry$image

read -p "memcached"
maintainer=""
image="memcached:1.6.18"
docker pull $maintainer$image
docker tag $maintainer$image $aliregistry$image
docker push $aliregistry$image

read -p "seafile"
maintainer="seafileltd/"
image="seafile-mc:11.0-latest"
docker pull $maintainer$image
docker tag $maintainer$image $aliregistry$image
docker push $aliregistry$image

# read -p "mihomo"
# maintainer="metacubex/"
# image="mihomo:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "metacubexd"
# maintainer="ghcr.io/metacubex/"
# image="metacubexd:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "kanboard"
# maintainer="kanboard/"
# image="kanboard:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "lobe-chat"
# maintainer="lobehub/"
# image="lobe-chat:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "sftpgo"
# maintainer="drakkan/"
# image="sftpgo:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "syncthing"
# maintainer="syncthing/"
# image="syncthing:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "maybe"
# maintainer="ghcr.io/maybe-finance/"
# image="maybe:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "postgres"
# maintainer=""
# image="postgres:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "vikunja"
# maintainer="vikunja/"
# image="vikunja:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "wekan"
# maintainer="ghcr.io/wekan/"
# image="wekan:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "actual"
# maintainer="actualbudget/"
# image="actual-server:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "mariadb"
# maintainer=""
# image="mariadb:lts"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "mongo"
# maintainer=""
# image="mongo:6"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "radicale"
# maintainer="tomsquest/"
# image="docker-radicale:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "planka"
# maintainer="ghcr.io/plankanban/"
# image="planka:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "fireflyiii-data-importer"
# maintainer="fireflyiii/"
# image="data-importer:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image ${aliregistry}fireflyiii-data-importer:latest
# docker push ${aliregistry}fireflyiii-data-importer:latest

# read -p "freshrss"
# maintainer="freshrss/"
# image="freshrss:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "shiori"
# maintainer="ghcr.io/go-shiori/"
# image="shiori:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "fava"
# maintainer="yegle/"
# image="fava:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "portainer"
# maintainer="portainer/"
# image="portainer-ee:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "dufs"
# maintainer="sigoden/"
# image="dufs:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "chatgpt-next-web"
# maintainer="yidadaa/"
# image="chatgpt-next-web:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "tasks.md"
# maintainer="baldissaramatheus/"
# image="tasks.md:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "miniflux"
# maintainer="miniflux/"
# image="miniflux:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "alpine"
# maintainer=""
# image="alpine:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "mariadb"
# maintainer=""
# image="mariadb:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "gitea"
# maintainer="gitea/"
# image="gitea:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "lobe-chat"
# maintainer="lobehub/"
# image="lobe-chat:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "fireflyiii"
# maintainer="fireflyiii/"
# image="core:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image ${aliregistry}fireflyiii-core:latest
# docker push ${aliregistry}fireflyiii-core:latest

# read -p "koreader"
# maintainer="ghcr.io/zephyros-dev/"
# image="koreader:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "seafile-mc"
# maintainer="seafileltd/"
# image="seafile-mc:11.0-latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "memcached"
# maintainer=""
# image="memcached:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "dufs"
# maintainer="sigoden/"
# image="dufs:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "linkding"
# maintainer="sissbruecker/"
# image="linkding:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "wallabag"
# maintainer="wallabag/"
# image="wallabag:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p ""
# maintainer="/"
# image=":latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "grafana"
# maintainer="grafana/"
# image="grafana:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "prometheus"
# maintainer="prom/"
# image="prometheus:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

# read -p "node-exporter"
# maintainer="prom/"
# image="node-exporter:latest"
# docker pull $maintainer$image
# docker tag $maintainer$image $aliregistry$image
# docker push $aliregistry$image

echo "Docker Images Update Finish!"